﻿package com.dykj.apps.web.sysmanager.service;

import com.dykj.apps.web.sysmanager.dao.ILogDAO;
import com.dykj.apps.web.sysmanager.dao.po.SysUser;
import com.dykj.apps.web.sysmanager.dto.SysUserDTO;
import com.dykj.platform.framework.utils.BeanUtils;
import com.dykj.platform.framework.exception.ApplicationException;
import com.dykj.platform.framework.exception.DatabaseException;;

public class LogBSImpl implements ILogBS {
	private ILogDAO dao;
	public SysUserDTO login(String userid, String pwd) throws ApplicationException {
		SysUserDTO dto = new SysUserDTO();
		try {
			Object obj = dao.getObject(SysUser.class, userid);
			if(null!=obj){
				BeanUtils.copyProperties(dto, obj);
			}else{
				return null;
			}
		} catch (DatabaseException e) {
			e.printStackTrace();
			throw new ApplicationException(e);
		}

		return dto;
	}

	public void logout(String user) throws ApplicationException {
		// TODO Auto-generated method stub
		
	}
	/*
	 * ================================get set方法=====================================
	 */	
	public ILogDAO getDao() {
		return dao;
	}

	public void setDao(ILogDAO dao) {
		this.dao = dao;
	}

}
